import { createWebHashHistory, createRouter } from "vue-router";

const routes = [
    {
        path: "/",
        name: "Home",
        component: () => import("../views/Home.vue"),
    },
    {
        path: "/pinia",
        name: "Pinia",
        component: () => import("../views/Pinia.vue"),
    },
    {
        path: "/router",
        name: "Router",
        component: () => import("../views/Router.vue"),
    },
    {
        path: "/user/:id",
        name: "User",
        component: () => import("../views/User.vue"),
        props: true
    },
    {
        path: "/:pathMatch(.*)*",
        name: "NotFound",
        component: () => import("../views/NotFound.vue"),
    },
    // {
    //     path: '/user-:afterUser(.*)',
    //     name: "User",
    //     component: () => import("../views/User-Page.vue"),
    // },
    {
        path: '/:productId',
        name: 'Product',
        component: () => import("../views/Product.vue")
    },
    {
        path: '/:orderId(\\d+)',
        name: 'Order',
        component: () => import("../views/Order.vue")
    },
    {
        path: '/vue',
        name: 'Vue',
        component: () => import("../views/Vue.vue")
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})


export default router